<template>
  <div class="dog">
    <img
      :src="Url"
      alt=""
    />
    <!-- 添加点击事件 -->
    <p @click="btn">{{dogName}}</p>
  </div>
</template>

<script>
export default {
  props:['Url','dogName'],
  methods:{
    btn() {
      this.$emit('clickDog',this.dogName)
    }
  }
}
</script>

<style>
.dog {
  float: left;
  padding-bottom: 15px;
  width: 300px;
  height: 250px;
  border: 1px solid black;
  text-align: center;
}
img {
  width: 300px;
  height: 200px;
}
</style>
